from django.urls import path, include
from . import views
from django.contrib.auth.views import LogoutView

urlpatterns = [
    path('', views.index, name='index'),
    path('books/', views.BookListView.as_view(), name='books'),
    path('book/<int:pk>', views.BookDetailView.as_view(), name='book-detail'),
    path('mybooks/', views.mybooks, name='my-borrowed'),
    path('book/<uuid:pk>/renew/', views.renew_book_librarian, name='renew-book-librarian'),
    path('author/create/', views.AuthorCreate.as_view(), name='author-create'),
    path('author/<int:pk>/update/', views.AuthorUpdate.as_view(), name='author-update'),
    path('author/<int:pk>/delete/', views.AuthorDelete.as_view(), name='author-delete'),
    path('authors/', views.authors, name='authors'),
    path('author/<int:pk>/', views.author_detail, name='author-detail'),
    path('borrowed/', views.borrowed, name='all-borrowed'),
    path('book/create/', views.book_create, name='book-create'),
    path('book/<int:pk>/update/', views.BookUpdateView.as_view(), name='book-update'),
    path('book/<int:pk>/delete/', views.BookDeleteView.as_view(), name='book-delete'),
    path('book/<int:pk>/rate/', views.rate_book, name='rate-book'),
    path('book/<int:pk>/review/', views.review_book, name='review-book'),
    path('books/rank/', views.book_rank, name='book-rank'),
    path('book/<int:pk>/like/', views.like_book, name='like-book'),
    path('book/<int:pk>/borrow/', views.borrow_book, name='borrow-book'),
    path('bookinstance/<str:pk>/return/', views.return_book, name='return-book'),
    path('accounts/account/', views.account_center, name='account'),
    path('accounts/', include('django.contrib.auth.urls')),
    path('accounts/logout/', LogoutView.as_view(next_page='/accounts/login/'), name='logout'),
    path('api/ai_chat/', views.ai_chat, name='ai_chat'),
]

